Internal Functions

Online IVR Tutorial


        Following are the built-in functions supported by the Xtend IVR engine.


The activeCalls() function obtains the number of calls active in the dialed line.
Syntax
$numInteger = ActiveCalls(<dli>)

Tell me more!

The activePorts() function obtains the number of ports being monitored by the IVR.
Syntax
$numInteger = ActivePorts()

Tell me more!

The alltrim() function trims all the leading and trailing white-space characters, tabs, carriage return and line feed from the string parameter and returns trimmed string.
Syntax
$trimmedString = alltrim(<string>)

Tell me more!

The ascii() function returns the ASCII code of the character entered.
Syntax
$asciiCode = ascii(<character>)

Tell me more!

AtomicAdd() function increments the value of a variable in a particular device.
Syntax
AtomicAdd(<deviceId>, <$variable>, <value>)

Tell me more!

AtomicGet() function gains access to the variables across devices.
Syntax
$valueString = AtomicGet(<deviceId>, <$variable>)

Tell me more!

AtomicSet() function sets the value of a variable in a particular device.
Syntax
AtomicSet(<deviceId>, <$variable>, <value>)

Tell me more!

The BlindTransfer() function blindly transfers the call to the particular extension phone.
Syntax
$statusBoolean = BlindTransfer(<extensionNumber>)

Tell me more!

The Calls() function obtains the number of calls handled by the current port.
Syntax
$numInteger = Calls(<dli>)

Tell me more!

The chr() function will return the character if given its ASCII code.
Syntax
$character = chr(<number>)

Tell me more!

ComClose() closes the serial port communication connection.
Syntax
ComClose()

Tell me more!

ComOpen() establishes a connection with the serial port.
Syntax
ComOpen("<Communication Port>", "<BaudRate> <Parity, Databits, Stopbits> <FlowControl>",)

Tell me more!

ComRead() reads data from the serial port.
Syntax
$buffer = ComRead(<Size>, <Timeout>)

Tell me more!

ComReadLine() reads a single line of data from the serial port.
Syntax
$buffer = ComReadLine(<Timeout>)

Tell me more!

ComReadSize() finds out the size of the data in the serial port that are ready to be read.
Syntax
$size = ComReadSize()

Tell me more!

ComWrite() writes data to the serial port.
Syntax
comWrite(<buffer>)

Tell me more!

ComWriteLine() writes a line of data to the serial port.
Syntax
ComWriteLine(<buffer>)

Tell me more!

The compare() function will compare two strings.
Syntax
$integer = compare(<String1>, <String2>)

Tell me more!

The concat() function will return a copy of the string after appending all given strings (<string1>, <string2>, ....).
Syntax
$concatenatedString = concat(<string1>, <string2>, ....)

Tell me more!

Convert() is used to convert the wave file into the specified wave format and saves it in a separate file.
Syntax:
$status = wave.Convert ("<Source Filename >","<Codec>","[Target Filename]")

Tell me more!

CountMessage() returns the total number of messages present in the message queue of the specified device.
Syntax:
$TotalMsg = CountMessage([DeviceId])

Tell me more!

The Datasize() function returns the data size of the wave file.
Syntax:
$size = wave.datasize ("<Wavefile>","[Compr]")

Tell me more!

DeleteFile() function deletes the specified file and returns boolean value true if file deleted, false otherwise.
Syntax
$boolean = DeleteFile(<filename>)

Tell me more!

DeviceSpecific() executes a function unique to a specific driver.
Syntax
DeviceSpecific(<functionName>[, parameters])

Tell me more!

Dial() makes an outgoing call.
Syntax
$bool = Dial(<Phone Number>)

Tell me more!

The Encrypt() function is to encrypt the wave file using the encryption type BLOWFISH or XOR.
Syntax
$bool = wave.Encrypt ("<Wave Filename>","<Password>","<Type>","[Destination File]")

Tell me more!

Escape() function converts the binary characters in the string to its percentage(%) hexa form.
Syntax
$escapedString = Escape(<string>)

Tell me more!

The ExtractXmlTag() function is used to retrieve the text in which the tag should be searched for and returns the text as per the specified offset value.
Syntax:
$xmltext = ExtractXmlTag ( <xmldata>, <starting tag>, <ending tag>, [offset] )

Tell me more!

The Find() function finds a character or substring inside a larger string and returns the zero-based index of the first character in the 'Master string'.
Syntax
$index = Find(<Master string>, <Sub string>, [Offset])

Tell me more!

Format() function writes formatted data to a string.
Syntax
$formattedString = Format(fcString [,arguments]..)

Tell me more!

Fraction() function returns the fractional portion of the number.
Syntax
$numericInteger = Fraction(<number>)

Tell me more!

The Get() function is to get specific web page.
Syntax
$Page = http.Get("<URL>")

Tell me more!

The GetCallProgress() function obtains the current status of a Dial() or Transfer() operation.
Syntax
$statusString = GetCallProgress()

Tell me more!

The Get2File() is to get specific web page into a file.
Syntax
$Status = http.Get2File("<URL>","<Filename>")

Tell me more!

The GetInfo() function retrieves information from the driver DLL.
Syntax
$infoString = GetInfo(<attribute>)

Tell me more!

GetMessage() function fetches a string from the message queue of the specified device.
Syntax
$msgString = GetMessage(<deviceId>)

Tell me more!

The GetStartTime() function generates the starting date and time of the IVR.
Syntax
$dateTime = GetStartTime()

Tell me more!

The GetTag() function is used to retrieve the remark attached to a tag/label within the wave file.
Syntax
$bool=wave.GetTag ("<Wave Filename>","<Tag>")

Tell me more!

The GetTickCount() retrieves the number of milliseconds that have elapsed since the system had started.
Syntax
$intCount = GetTickCount()

Tell me more!

The GetTime() function fetches the local date and time.
Syntax
$dateTime = GetTime()

Tell me more!

The hashoffile() function gives the hash value of any type of file.
Syntax
$hash = md5.hashoffile("<filename>")

Tell me more!

The hashofstring() function gives the hash value of specified string.
Syntax
$hash = md5.hashofstring ("<String>")

Tell me more!

The hashofwavedata() function gives the hash value of of wave file.
Syntax
$hash = md5.hashofwavedata("<Wavefile>")

Tell me more!

Index() function returns the zero-based index of a substring or a character inside a larger string. If sub string or character is not found, it will return -1. Index function has the same syntax as that of Find() function.
Syntax
$index = Index(<Master string>, <Sub string>)

Tell me more!

The init() function is used to initialize the specific port in order to send and receive data.
Syntax
udp.init("<Port>")

Tell me more!

The input() function will accept numbers entered on the dial-pad by the user.
Syntax
$inputKey = input(<max digits>, [wait in seconds], [enter key], [esc key], [mask])

Tell me more!

Integer() function returns the integral part of the number.
Syntax
$numericInteger = Integer(<number>)

Tell me more!

IsVariable() function searches for the given variable anywhere inside the script and returns 1 if present, 0 otherwise.
Syntax
$boolean = IsVariable("$variable")

Tell me more!

The len() function will return the length of the <string>.
Syntax
$length = len(<string>)

Tell me more!

The left() function will return the leftmost length of the <string>.
Syntax:
$LeftString = left(<string>, <len>)

Tell me more!

LoadFile() function loads the specified number of lines of text from the file to a variable.
Syntax
$boolean = LoadFile(<filename>, <$variable>, <NoOfLines>)

Tell me more!

Lock() function permits one and only one script to execute inside a block of statements.
Syntax
Lock(<name>)

Tell me more!

The Loudness() function gives the maximum frequency of the wave within the given block size.
Syntax
$val = wave.loudness ("<Wave Filename >",[Block Size],"[Freqstoignore]")

Tell me more!

The lower() function will return a copy of the <string> converted to lowercase.
Syntax
$lowerCaseString = lower(<string>)

Tell me more!

The ltrim() function will return a copy of the <string> after removing all the leading spaces.
Syntax
$leadingSpaceTrimmedString = ltrim(<string>)

Tell me more!

The Merge() function merges two waves and store it in the specified location.
Syntax
$stat = wave.merge ("<Wavefile1>","<Wavefile2>","<Destination Filename>")

Tell me more!

Mid() function extracts a substring of length [len] characters from <string>.
Syntax
$extractedString = mid(<string>, <start index>, [len])

Tell me more!

PlayTimeLeft() function returns the pending play back time in milliseconds.
Syntax
$timeInteger = PlayTimeLeft()

Tell me more!

PutMessage() function places a string into the message queue of the specified device.
Syntax
PutMessage(<deviceId>, <string>)

Tell me more!

The receive() function used to receive UDP data from a specific UDP port
Syntax
udp.receive("<Timeout>")

Tell me more!

The RecordTimeLeft() function returns the remaining time for recording.
Syntax
$timeInteger = RecordTimeLeft()

Tell me more!

The Reverse() function reverses a given string.
Syntax:
$index = Reverse(<Master string>, <Sub string>)

Tell me more!

The ReverseFind() function finds a character or substring inside a larger string starting the search from the end.
Syntax
$index = ReverseFind(<Master string>, <Sub string>)

Tell me more!

The right() function will return the rightmost length of the <string>.
Syntax:
$RightString = right(<string>, <len>)

Tell me more!

Rindex() function returns the zero-based index of a substring or a character inside a larger string starting the search from the end. Rindex() has the same syntax as that of ReverseFind() function.
Syntax
$index = Rindex(<Master string>, <Sub string>)

Tell me more!

The rtrim() function will return a copy of the <string> after removing all the trailing whitespaces.
Syntax
$trailingSpaceTrimmedString = rtrim(<string>)

Tell me more!

SaveFile() function replaces the content from the variable with that of the file by the specified number of lines.
Syntax
$boolean = SaveFile(<filename>, <$variable>, <NoOfLines>)

Tell me more!

The seconds() function gives the time elapsed in seconds after the process has started.
Syntax
$timePeriod = seconds()

Tell me more!

The send() function sends data to the UDP port of the specified IP address.
Syntax
udp.send("<IP>",<Port>,"<Data>")

Tell me more!

The SetInfo() function sets the attribute of the driver.
Syntax
SetInfo(<attribute>, <value>)

Tell me more!

The SetTag() Used to add a tag/label within the wave file.
Syntax
$bool=wave.SetTag ("<Wave Filename>","<Tag>","<Remark>")

Tell me more!

The SetVariable() function changes the scope of the variable from local to global and assigns value to all instances of the variable.
Syntax
SetVarInVar(<variable>, <value>)

Tell me more!

SoftDisconnect() function destroys a softInterconnect with a specified device.
Syntax
SoftDisconnect(<deviceId>)

Tell me more!

SoftInterConnect() function interconnects the current device and the specified device.
Syntax
SoftInterConnect(<deviceId>)

Tell me more!

SoftListen() function listens to a particular channel.
Syntax
SoftListen(<deviceId>[, Type])

Tell me more!

SoftStream() function streams the Incoming, Outgoing or both audio of the current device to the incoming audio of the specified device.
Syntax
SoftStream(<deviceId>[, Type])

Tell me more!

SoftUnlisten() function unlistens from the specified device.
Syntax
SoftUnlisten(<deviceId>)

Tell me more!

SoftUnstream() function releases SoftStream() to the specified device.
Syntax
SoftUnstream(<deviceId>)

Tell me more!

The srAcceptWords() function defines the grammar for the subsequent Input() operation.
Syntax
srAcceptWords(<word 1>, <word 2>, ..., <word N>)

Tell me more!

The srAudio() function specifies when the audio play back has to be stopped.
Syntax
srAudio (<type>)

Tell me more!

The srConfidence() function determines the level of recognition for the words/ grammar defined.
Syntax
$levelInteger = srConfidence()

Tell me more!

The srGrammar() function loads grammar for speech recognition in the script.
Syntax
srGrammar(<fileName>)
or
srGrammar(<actualXmlText>)

Tell me more!

The srKeepGrammar() function sets the grammar for the subsequent Input() operation in the script.
Syntax
srKeepGrammar(<boolean>)

Tell me more!

SubStr() function extracts a substring from a larger string and has the same syntax as that of mid() function.
Syntax
$extractedString = substr(<string>, <start index>, [len])

Tell me more!

The TotalCalls() function obtains the total number of calls handled by the IVR so far.
Syntax
$numInteger = TotalCalls()

Tell me more!

The Transfer() function transfers the call to an extension phone.
Syntax
$statusString = Transfer(<extensionNumber>, <timeout>)

Tell me more!

The Type() function returns the type of the wave file.
Syntax
$val = wave.type ("<Wavefile>")

Tell me more!

The upper() function will return a copy of the <string> converted to uppercase.
Syntax
$upperCaseString = upper(<string>)

Tell me more!

The UnEscape() function reverses the Escape() process.
Syntax
$unEscapedString = UnEscape(<string>)

Tell me more!

The UnLock() function releases the last Lock() operation.
Syntax
UnLock()

Tell me more!